using System;
using System.Globalization;

namespace libntregsharp
{
	public static class NTUtils
	{
		public static long SMBHexStampToUnixLong(string hex)
		{
			long smb = long.Parse(hex, NumberStyles.HexNumber);
			
			return (smb / 10000000) - 116444736000000000;
		}
		
		public static DateTime ConvertFromUnixTimestamp(long timestamp)
		{
		    DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
		    return origin.AddSeconds(timestamp);
		}
	}
}

